using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using System.Drawing;

namespace SBPweb.Themes.Windows.Skins
{
	/// <summary>
	/// Class of Size
	/// </summary>
	public class Size
	{
		private SizeF mMinSize = new SizeF(17,17);

		/// <summary>
		/// Constructor of Size
		/// </summary>
		public Size()
		{
		}

		/// <summary>
		/// Constructor of Size
		/// </summary>
		/// <param name="width">width</param>
		/// <param name="height">height</param>
		public Size(int width, int height)
		{
			mMinSize.Width = width;
			mMinSize.Height = height;
		}

		/// <summary>
		/// Get size from xml node
		/// </summary>
		/// <param name="node">xml node</param>
		public Size(XmlNode node)
		{
			XmlAttribute minSize = node.Attributes["MinSize"];

			if (node != null && minSize != null)
			{
				string s = minSize.Value;
				string[] stringArray = s.Split(',');
				float width = float.Parse(stringArray[0].Substring(7));
				float height = float.Parse(stringArray[1].Substring(6));

				mMinSize = new SizeF(width, height);
			}

		}

		/// <summary>
		/// Minimum size
		/// </summary>
		public SizeF MinSize
		{
			get
			{
				return mMinSize;
			}
		}	
	}
}
